#include<cstdio>
#include<malloc.h>
#include<iostream>
using namespace std;
/*
10
5 1 9 10 67 12 8 33 6 2
3 10
*/
typedef int Status;
typedef int ElemType;
typedef struct
{
    ElemType *elem;
    int length;
    int listsize;
}SqList;

Status InitList_Sq(SqList &L) {
    L.elem = (ElemType *) malloc(100 * sizeof(ElemType));
    if (!L.elem) {
        exit(-2);
    }
    L.length = 0;
    L.listsize = 100;
    return true;
}
int main()
{
    SqList L,newL;
    int x,y;
    scanf("%d",&L.length);
    L.elem=(int*)malloc(sizeof(int)*L.length);
    if(L.elem==NULL)
        return -2;
    for(int i=0;i<L.length;i++)
        scanf("%d",&L.elem[i]);
    scanf("%d%d",&x,&y);

    int p=0;
    newL.elem=(int*)malloc(sizeof(int)*L.length);
    newL.length=0;
    for(int i=0;i<L.length;i++)
    {
        if(L.elem[i]<x || L.elem[i]>y)
        {
            newL.elem[p++]=L.elem[i];
            newL.length++;
        }
    }
    for(int i=0;i<newL.length-1;i++)
        cout<<newL.elem[i]<<" ";
    cout<<newL.elem[newL.length-1];
}
